<!DOCTYPE HTML>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="format-detection" content="telephone=no">
		<meta name="description" content="">
		<meta http-equiv="x-dns-prefetch-control" content="on">
		<title>更换领队</title>
		<link href="../imgv2/css/css.css" rel="stylesheet" type="text/css">
		<style>
			.itemarrow.arrow-noactive,
			.itemarrow.arrow-noactive li {
				display: none;
			}
			.itemarrow.arrow-active,
			.itemarrow.arrow-active li {
				display: '';
			}
			.friends-list {
				margin-bottom: 20px;
			}
		</style>
	</head>

	<body class="whitebg">
		<!--wrap start-->
		<section id="wrap">
			<section class="titlebar">更换领队</section>
			<section class="citylist whitebg friends-list">
				<!-- <a href="javascript:void(0);">
          <img src="img/user_pic.png" width="100%" height="100%" class="tripuser"/>
          <ul class="listitem h120 bottomline">
              <li class="itemcon lh120">永远的永远</li>
              <li class="itemarrow lh120"><i class="iconfont blue">&#xe603;</i></li>
          </ul>
          </a>
          <a href="javascript:void(0);">
          <img src="img/user_pic.png" width="100%" height="100%" class="tripuser"/>
          <ul class="listitem h120 bottomline">
              <li class="itemcon lh120">永远的永远</li>
          </ul>
          </a>
          <a href="javascript:void(0);">
          <img src="img/user_pic.png" width="100%" height="100%" class="tripuser"/>
          <ul class="listitem h120 bottomline">
              <li class="itemcon lh120">永远的永远</li>
          </ul>
          </a>
          <a href="javascript:void(0);">
          <img src="img/user_pic.png" width="100%" height="100%" class="tripuser"/>
          <ul class="listitem h120 bottomline">
              <li class="itemcon lh120">永远的永远</li>
          </ul>
          </a>
          <a href="javascript:void(0);">
          <img src="img/user_pic.png" width="100%" height="100%" class="tripuser"/>
          <ul class="listitem h120 bottomline">
              <li class="itemcon lh120">永远的永远</li>
          </ul>
          </a> -->
			</section>
			<section class="bottombtnarea">
				<ul class="listitem h60">
					<button id="btnOK" class="bigbtn button" onClick="this.className='button_d bigbtn'" onmouseout="this.className='bigbtn button'">确定</button>
				</ul>
			</section>
		</section>
		<!--wrap end-->
		<script src="../jsv2/jQuery/jquery-1.11.2.min.js"></script>
		<script src="../jsv2/common.js"></script>
		<script src="../jsv2/lib/json3.min.js"></script>
		<script src="../jsv2/QueryStringParser.js"></script>
		<script src="../jsv2/jsonMsg.js"></script>
		<script src="../jsv2/lib/k-utils-fn.js"></script>
		<script src="../jsv2/journey/operateData.js"></script>
		<script>
			var parentwin = window.parent,
				tripDetailData,
				openId, tripId, isActive;
			$(function() {
				openId = queryString.getParam("openid");
				tripId = queryString.getParam("tripid");
				isActive = queryString.getParam("isActive");
				/*$('.friends-list').css({
					'height': (K.getPageSize()[1] - 100) + 'px'
				});*/
				$(document).on('click', '.friends-list a', function(e) {
					var tar = $(e.target);
					tar = _getTarparanet(tar, {
						key: 'tagName',
						'value': 'A'
					});
					$('.friends-list .itemarrow').removeClass('arrow-active').addClass('arrow-noactive');
					$('.itemarrow', tar).removeClass('arrow-noactive').addClass('arrow-active');
				});
				$('#btnOK').on('click', function() {
					var tar = _getTarparanet($('.friends-list a .arrow-active'), {
						key: 'tagName',
						'value': 'A'
					});
					tripDetailData.TripLeader = tar.attr('OpenID');
					bidgeToWeixin(openId, 'EditTrip', tripDetailData, function(data, status, xhr) {
						window.location.href = 'trip_detail.html?openid=' + openId + '&isActive=' + isActive + '&tripid=' + tripId;
					});
				});
				bidgeToWeixin(openId, 'TripDetail', {
					"TripID": tripId
				}, function(data, status, xhr) {
					var data = data.portalResp.Data,
						innerContain = [];
					tripDetailData = data;
					$.each(data.MemberStatus, function(index) {
						innerContain.push('<a href="javascript:void(0);" OpenID="' + data.MemberStatus[index].OpenID + '">');
						innerContain.push('		<img src="' + data.MemberStatus[index].ImageURL + '" width="100%" height="100%" class="tripuser" />');
						innerContain.push('		<ul class="listitem h120 bottomline">');
						innerContain.push('			<li class="itemcon lh120">' + data.MemberStatus[index].Nickname + '</li>');
						innerContain.push('			<li class="itemarrow lh120 ' + (data.TripLeader == data.MemberStatus[index].OpenID ? 'arrow-active' : 'arrow-noactive') + '"><i class="iconfont blue">&#xe603;</i></li>');
						innerContain.push('		</ul>');
						innerContain.push('</a>');
					});
					$(".friends-list").html(innerContain.join(''));
				});
			});
		</script>
	</body>

</html>